package com.company;

import java.util.*;

/**
 * @author yd
 */

/**
 * 倒序输出数组
 *
 */
public class ArrayTest {
    public static int[] reverseArray2(int[] nums) {
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < nums.length; i++) {

            list.add(nums[i]);
        }
        Collections.reverse(list);

        int [] reNums = new int[nums.length];

        for (int i = 0; i <list.size() ; i++) {
            reNums[i] = list.get(i);

        }
        return  reNums;
    }
    public static void main(String[] args) {
        int [] sn= {1,1,4,5,6,7};
       ;
        for (int i =0;i<  reverseArray2(sn).length;i++){
            int t=  reverseArray2(sn)[i];
            System.out.print(t);
        }






    }
}
